﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/H-ui/lib/html5shiv.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/H-ui/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/static/H-ui/static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css"
          href="${pageContext.request.contextPath}/static/H-ui/lib/Hui-iconfont/1.0.8/iconfont.min.css"/>
    <!--[if lt IE 9]>
    <link href="${pageContext.request.contextPath}/static/H-ui/static/h-ui/css/H-ui.ie.css" rel="stylesheet"
          type="text/css"/>
    <![endif]-->
    <!--[if IE 6]>
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/static/H-ui/lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <style type="text/css">
        .ui-sortable .panel-header {
            cursor: move
        }
    </style>
    <title>Merely Better</title>
<%--    <meta name="keywords" content="关键词,5个左右,单个8汉字以内">
    <meta name="description" content="网站描述，字数尽量空制在80个汉字，160个字符以内！">--%>
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <script>
        (adsbygoogle = window.adsbygoogle || []).push({
            google_ad_client: "ca-pub-5783451498983336",
            enable_page_level_ads: true
        });
    </script>
</head>
<body ontouchstart>
<div class="containBox">
    <div class="containBox-bg"></div>
    <header class="navbar-wrapper">
        <div class="navbar navbar-black navbar-fixed-top">
            <div class="container cl">
                <%--<a class="logo navbar-logo hidden-xs" href="#">Merely Better</a>--%>
<%--                <a class="logo navbar-logo-m visible-xs" href="/aboutHui.shtml">H-ui</a>
                <span class="logo navbar-slogan hidden-xs">简单 &middot; 免费 &middot; 适合中国网站</span>--%>
                <a aria-hidden="false" class="nav-toggle Hui-iconfont visible-xs JS-nav-toggle" href="javascript:;">&#xe667;</a>
                <nav class="nav navbar-nav nav-collapse" role="navigation" id="Hui-navbar">
                    <ul class="cl">
                        <li class="current">
                            <a href="http://www.aff.merelyb.com/" target="_blank">Home</a>
                        </li>
                        <li>
                            <a href="#" target="_blank">Offers</a>
                        </li>
                        <li>
                            <a href="#" target="_blank">Buy Account</a>
                        </li>
                        <li>
                            <a href="#" target="_blank">Contact us</a>
                        </li>
                    </ul>
                </nav>
                <nav class="navbar-userbar hidden-xs"></nav>
            </div>
        </div>
    </header>
    <div class="wap-container">
<%--        <nav class="breadcrumb">
            <div class="container">
                <i class="Hui-iconfont">&#xe67f;</i>
                <a href="#" class="c-primary">Home</a>
                <span class="c-gray en">&gt;</span>
&lt;%&ndash;                <a href="#"></a>
                <span class="c-gray en">&gt;</span>
                <span class="c-gray"></span>&ndash;%&gt;
            </div>
        </nav>--%>
        <div class="container ui-sortable">
            <h2>Merely Better</h2>
            <div class="page-container">
                <div class="cl bg-1 bk-gray">
                    <span class="l">
                        <form method="post" action="${pageContext.request.contextPath}/page/info.do" id="criteria">
                            <table>
                                <tr>
                                    <td style="width: 160px; padding-right: 24px;">
                                        <span class="select-box">
                                            <select class="select" size="1" id="PayMethod" name="PayMethod">
                                                <option value="" selected>Pay Method</option>
                                                <c:forEach items="${payMethodList}" var="item">
                                                    <option>${item}</option>
                                                </c:forEach>
                                            </select>
                                        </span>
                                    </td>
                                    <td style="width: 160px; padding-right: 24px;">
                                        <span class="select-box">
                                            <select class="select" size="1" id="PayFre" name="PayFre">
                                                <option value="" selected>Pay Frequency</option>
                                                <c:forEach items="${payFreList}" var="item">
                                                    <option>${item}</option>
                                                </c:forEach>
                                            </select>
                                        </span>
                                    </td>
                                    <td style="width: 160px; padding-right: 24px;">
                                        <span class="select-box">
                                            <select class="select" size="1" id="MinPay" name="MinPay">
                                                <option value="" selected>Min-Pay</option>
                                                <c:forEach items="${payMinList}" var="item">
                                                    <option>${item}</option>
                                                </c:forEach>
                                            </select>
                                        </span>
                                    </td>
                                    <td style="width: 160px; padding-right: 24px;">
                                        <span class="select-box">
                                            <select class="select" size="1" id="PayCom" name="PayCom">
                                                <option value="" selected>Pay Commission</option>
                                                  <c:forEach items="${payCommList}" var="item">
                                                      <option>${item}</option>
                                                  </c:forEach>
                                            </select>
                                        </span>
                                    </td>

                                    <td>
                                        <button type="button" class="btn btn-success radius" id="btnSubmit"
                                                onclick="RefreshPage(1)"><i
                                                class="Hui-iconfont">&#xe665;</i></button>
                                    </td>
                                </tr>
                            </table>
                        </form>
                    </span>
                    <span class="r" id="TotalNum">
                        <input type="hidden" id="curPage" value="${cPage}">
                        <input type="hidden" id="tolPage" value="${pTotal}">
                        <strong>${bNum} - ${eNum} / ${nTotal}</strong>
                    </span>
                </div>
                <div class="mt-10">
                    <table class="table table-border table-bordered table-hover table-bg">
                        <thead>
                        <tr class="text-c">
                            <th width="25px"><input type="checkbox" name="" value=""></th>
                            <th width="80px"></th>
                            <th width="120px"></th>
                            <th width="200px">Pay-Commission</th>
                            <th width="80px">Min-Pay</th>
                            <th>Pay-Frequency</th>
                            <th width="80px"></th>
                        </tr>
                        </thead>
                        <tbody id="affInfo">
                        <c:forEach items="${lists}" var="item">
                            <tr class="text-c">
                                <td width="25px"><input type="checkbox" value="${item.id}" name=""></td>
                                <td width="80px">
                                    <strong class="f-l f-10 va-m">${item.affpayName}</strong></td>
                                <td width="120px">
                                    <img src="${pageContext.request.contextPath}/${item.imgUrl}"
                                         width="108px"
                                         height="46px">
                                </td>
                                <td width="200px">${item.payCommission}</td>
                                <td width="120px"> ${item.minimumPayment}</td>
                                <td>${item.paymentFrequency}</td>
                                <td>
                                    <input class="btn btn-warning-outline radius"
                                           onclick="window.open('${item.registUrl}')" type="button"
                                           value="Regist">
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
                <div class="mt-10">
                <span class="text-c" id="pageNum">
                    <div class="btn-group">
                      <span class="btn btn-default radius" onclick="prevPage();">Prev</span>
                      <span class="btn btn-default radius" onclick="nextPage();">Next</span>
                    </div>
                </span>
                </div>
            </div>
        </div>
        <footer class="footer mt-5">
            <div class="container">
                <nav class="footer-nav">
                    <a target="_blank" href="#">Contact us</a>
                    <span class="pipe">|</span>
                    <a target="_blank" href="#">Paypal Contributions</a>
                </nav>
                <p>Copyright &copy;2017-2018 Merelyb.com All Rights Reserved. <br>
                    <a rel="nofollow" target="_blank" href="http://www.miitbeian.gov.cn/">京ICP备18000545号-1</a>
                </p>
            </div>
        </footer>
    </div>
</div>
<script type="text/javascript"
        src="${pageContext.request.contextPath}/static/H-ui/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript"
        src="${pageContext.request.contextPath}/static/H-ui/lib/jquery-ui/1.9.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/H-ui/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript"
        src="${pageContext.request.contextPath}/static/H-ui/lib/jquery.SuperSlide/2.1.1/jquery.SuperSlide.min.js"></script>
<script type="text/javascript"
        src="${pageContext.request.contextPath}/static/H-ui/lib/jquery.validation/1.14.0/jquery.validate.min.js"></script>
<script type="text/javascript"
        src="${pageContext.request.contextPath}/static/H-ui/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript"
        src="${pageContext.request.contextPath}/static/H-ui/lib/jquery.validation/1.14.0/messages_zh.min.js"></script>
<script type="text/javascript">
    function prevPage() {
        var iPage = $("#curPage").val();
        if (parseInt(iPage) > 1) {
            RefreshPage(parseInt(iPage) - 1);
        }
    }

    function nextPage() {
        var iPage = $("#curPage").val();
        var tolPage = $("#tolPage").val();
        if (parseInt(iPage) + 1 <= parseInt(tolPage)) {
            RefreshPage(parseInt(iPage) + 1);
        }
    }

    function RefreshPage(iPage) {
        var sPayMethod = $("#PayMethod option:selected").text();
        var sPayFre = $("#PayFre option:selected").text();
        var sMinPay = $("#MinPay option:selected").text();
        var sPayCom = $("#PayCom option:selected").text();
        $.ajax({
                type: "POST",
                url: $("#criteria").attr("action"),
//            contentType: 'application/json;charset=utf-8',
                data: {
                    PayMethod: sPayMethod,
                    PayFre: sPayFre,
                    MinPay: sMinPay,
                    PayCom: sPayCom,
                    queryPage: iPage
                },
                dataType: "json",
                success: function (data) {
                    if (data.isSuccessed == true) {
                        var affInfohtml = '';
                        if (typeof(data.lists ) != "undefined") {
                            $.each(data.lists, function (iIndex, affpayInfo) {
                                affInfohtml += '<tr class="text-c"> <td width="25px"><input type="checkbox" value="' + affpayInfo.id + '" name=""></td>';
                                affInfohtml += '<td width="80px"> <strong class="f-l f-10 va-m">' + affpayInfo.affpayName + '</strong></td>';
                                affInfohtml += '<td width="120px"><img src="${pageContext.request.contextPath}/' + affpayInfo.imgUrl + '" width="108px" height="46px">';
                                affInfohtml += '</td><td width=200px"> ' + affpayInfo.payCommission + '</td><td width=120px"> ' + affpayInfo.minimumPayment + '</td>';
                                affInfohtml += '<td>' + affpayInfo.paymentFrequency + '</td><td><input class="btn btn-warning-outline radius" onclick="window.open(\'' + affpayInfo.registUrl + '\')" type="button" value="Regist">';
                                affInfohtml += '</td></tr>';
                            });
                        }
                        $("#affInfo").html("");
                        $("#affInfo").html(affInfohtml);
                        var affPageHtml = '<input type="hidden" id="curPage" value="' + data.cPage + '"><input type="hidden" id="tolPage" value="' + data.pTotal + '"><strong id="TotalNum">' + data.bNum + ' -  ' + data.eNum + ' / ' + data.nTotal + '</strong> 条';
                        $("#TotalNum").html('');
                        $("#TotalNum").html(affPageHtml);
                    }
                }
            }
        )
        ;
    }
</script>
</body>
</html>